package dearchenpush.good.com.qianfanlive.modules.discover.adapter;

import android.content.Context;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import java.util.List;

/**
 * User: sgd(952519440@qq.com)
 * Date: 2016/09/28
 * Time: 14:55
 * progject: QianfanLive
 * Describe：
 */

public class ViewPagerFragmentAdapter extends FragmentPagerAdapter {

    private List<Fragment> mData;
    private Context mContext;
    private String[] name = {"猜你喜欢","热门直播"};

    public ViewPagerFragmentAdapter(FragmentManager fm, List<Fragment> data, Context context) {
        super(fm);
        mData = data;
        mContext = context;
    }

    public ViewPagerFragmentAdapter(FragmentManager fm) {
        super(fm);
    }

    @Override
    public Fragment getItem(int position) {
        return mData.get(position);
    }

    @Override
    public int getCount() {
        return mData != null ? mData.size() : 0;
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return name[position];
    }
}
